﻿/// <reference path="../jquery-1.9.1.js" />
/// <reference path="../referraltracker.js" />

referraltracker.home.index = (function () {

    function Verify() {
        var email = $("#EMail").val();
        var password = $("#Password").val();
        var data = {
            email: email,
            password: password
        };

        $.ajax({
            url: '/Account/VerifyCredentials',
            type: 'POST',
            data: data,
            dataType: 'json',
            success: OnVerify
        });
    }

    function OnVerify(result) {
        if (result.isvalid) {
            $("#form1").submit();
        }
        else {
            alert("Invalid Credentials");
        }
    }

    var _instance = {
        verify: Verify
    };

    return _instance;
})();